Skip to content

Conversation

@vvvvvoin
Copy link
Contributor

@vvvvvoin vvvvvoin commented Sep 15, 2025

  • 우측에 아이콘이 표시될 수 있돌고 파라미터를 확장합니다.
  • 하위호환성이 보장될 수 있도록 함수를 추가하고 deprecated 어노테이션을 추가합니다.
image image

Summary by CodeRabbit

  • 신기능

    • 배너 컴포넌트가 좌측 아이콘(leftIcon)과 선택적 우측 아이콘(rightIcon)을 공식 지원합니다.
    • 좌측 아이콘 색상 지정 가능하며 미지정 시 적절한 기본 색상이 적용됩니다.
    • 우측 아이콘은 미제공 시 기본 치브론(chevron)으로 표시됩니다.
    • 문자열 및 리치 텍스트(AnnotatedString) 설명을 위한 오버로드가 추가되었습니다.
  • 변경/사용 중단 안내

    • 기존 icon/iconColor 기반 API는 deprecated 처리되었으며 leftIcon 기반 새 API 사용 권장됩니다.
    • 예제 및 미리보기들이 새 옵션으로 업데이트되었습니다.

@channeltalk
Copy link

channeltalk bot commented Sep 15, 2025

@coderabbitai
Copy link

coderabbitai bot commented Sep 15, 2025

Walkthrough

Banner 공개 API가 icon/iconColor 기반에서 leftIcon/leftIconColor 및 선택적 rightIcon 기반으로 전환되었고, 기존 오버로드는 Deprecated 처리되었으며 내부 BannerLayout과 모든 프리뷰가 새 파라미터로 갱신되었습니다.

Changes

Cohort / File(s) Summary of Changes
Banner API 및 레이아웃 업데이트
bezier/src/main/java/io/channel/bezier/component/Banner.kt
- 새로운 공개 오버로드 2개 추가: description 유형별로 leftIcon, leftIconColor, rightIcon 지원(AnnotatedString/String).
- 기존 icon/iconColor 오버로드 2개를 @Deprecated로 표시하고 사용 대체 안내 추가.
- 내부 BannerLayout 시그니처 및 호출부를 leftIcon/leftIconColor/rightIcon으로 변경.
- 왼쪽 아이콘 렌더링(틴트 적용 조건화), 오른쪽 아이콘은 제공 시 사용하고 없으면 기본 chevron으로 대체하도록 렌더링 로직 수정.
- 설명 렌더링을 AnnotatedString/String 모두 지원하도록 통일된 스타일 적용.
- 파일 내 모든 프리뷰와 사용 예시를 새 API로 갱신.

Sequence Diagram(s)

sequenceDiagram
  participant Caller as 호출자
  participant Banner as Banner(...)
  participant Layout as BannerLayout
  participant UI as Compose UI

  Caller->>Banner: 호출 (leftIcon?, leftIconColor?, rightIcon?, description, ...)
  Banner->>Layout: 위임 (leftIcon, leftIconColor, rightIcon, description, ...)
  alt leftIcon 제공됨
    rect #E8F0FE
      Note over Layout: 왼쪽 아이콘 렌더링\n(틴트: leftIconColor 또는 기본)
      Layout->>UI: Render left icon
    end
  else
    Note over Layout: 왼쪽 아이콘 없음
  end
  alt rightIcon 제공됨
    rect #E8F8EE
      Note over Layout: 오른쪽 아이콘 렌더링
      Layout->>UI: Render right icon
    end
  else
    rect #FFF7E6
      Note over Layout: 기본 오른쪽 chevron 렌더링
      Layout->>UI: Render default chevron
    end
  end
  Layout->>UI: Render title / description / content
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

왼쪽엔 새 아이콘, 오른쪽엔 화살표 빛나네,
옛 오버로드는 조용히 퇴장하네.
레이아웃은 손질되어 줄을 서고, 색은 살짝 칠해져,
깡충 뛰는 토끼가 기뻐하며 축배를 들네. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed 이 PR의 제목은 "[MOB1-1742] 배너 스펙 확장 - left, right icon을 구분하여 설정할 수 있돌고 수정"로, 변경 사항의 핵심을 명확하게 반영하고 있습니다. 변경 사항 요약에 따르면 Banner 컴포넌트의 icon/iconColor 파라미터를 leftIcon/leftIconColor 및 rightIcon으로 확장하여 좌측과 우측 아이콘을 구분하여 설정할 수 있도록 개선한 것이 주요 변경 사항이며, 제목은 이를 정확하게 표현하고 있습니다. 제목은 구체적이고 명확하여 팀원이 커밋 히스토리를 스캔할 때 주요 변경 내용을 쉽게 이해할 수 있습니다.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5da2f14 and a3b640f.

📒 Files selected for processing (1)
  • bezier/src/main/java/io/channel/bezier/component/Banner.kt (13 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: check-build
🔇 Additional comments (7)
bezier/src/main/java/io/channel/bezier/component/Banner.kt (7)

42-68: 오버로드 해결 문제가 잘 해결되었습니다.

이전 리뷰에서 onebone님이 지적한 오버로드 해결 문제를 이 간단한 오버로드들이 해결합니다. Banner(type, description, title)로 호출할 때 기본 파라미터가 적은 이 오버로드가 우선 선택되므로, 의도하지 않게 deprecated 함수가 호출되는 문제가 방지됩니다.

위임 로직도 모든 파라미터를 named argument로 전달하여 정확합니다.


70-73: ReplaceWith 수정이 정확합니다.

이전 리뷰의 coderabbitai 지적사항대로 모든 파라미터가 named argument로 수정되어 컴파일 오류 가능성이 제거되었습니다.


97-99: 하위 호환성 처리가 올바릅니다.

Deprecated 함수에서 rightIcon = null을 명시적으로 전달하여 기존 API 사용 시 rightIcon이 표시되지 않도록 보장합니다. 이는 마이그레이션 중 예상치 못한 동작 변경을 방지합니다.


142-206: 새로운 API가 잘 설계되었습니다.

leftIcon/leftIconColor/rightIcon 파라미터 구조가 명확하고 일관성 있습니다. 이전 리뷰에서 논의된 대로 rightIconColor가 의도적으로 제외되었습니다(버튼 스펙에 따라 고정된 색상 사용).

향후 디자인 요구사항이 변경되면 rightIconColor 파라미터 추가를 고려할 수 있습니다.


245-253: leftIcon 렌더링 구현이 정확합니다.

null 체크와 takeOrElse를 사용한 기본 색상 처리가 적절하며, 기존 아이콘 렌더링 로직과 일관성을 유지합니다.


298-307: rightIcon 폴백 로직이 명확합니다.

rightIcon ?: painterResource(id = R.drawable.icon_chevron_small_right) 패턴으로 사용자 커스텀 아이콘을 지원하면서도 기본 동작(chevron 표시)을 유지합니다.

색상이 고정된 것은 이전 논의에서 언급된 디자인 결정사항입니다.


453-455: Preview에서 새로운 rightIcon 기능을 잘 시연합니다.

모든 Preview가 새 API로 일관되게 업데이트되었으며, 특히 이 Preview는 커스텀 rightIcon 사용 예시를 제공하여 새로운 기능을 명확히 보여줍니다.


Comment @coderabbitai help to get the list of available commands and usage tips.

@vvvvvoin vvvvvoin requested a review from onebone September 15, 2025 15:10
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
bezier/src/main/java/io/channel/bezier/component/Banner.kt (3)

114-146: 새 오버로드: rightIcon 노출 조건을 명문화(문서화)하세요

현재 구현은 onRemove != null이면 rightIcon이 무시되고, onClick != null일 때만(우측) 아이콘이 표시됩니다. 혼선을 줄이기 위해 KDoc로 명시해 주세요.

@@
-@Composable
-fun Banner(
+/**
+ * - leftIcon: 선행 아이콘.
+ * - rightIcon: onClick != null && onRemove == null 인 경우에만 표시됩니다.
+ */
+@Composable
+fun Banner(
@@
-@Composable
-fun Banner(
+/**
+ * - leftIcon: 선행 아이콘.
+ * - rightIcon: onClick != null && onRemove == null 인 경우에만 표시됩니다.
+ */
+@Composable
+fun Banner(

또한 제품 요구에 따라 우측 아이콘 색상 커스터마이즈가 필요하면 rightIconColor(Color = Color.Unspecified) 추가를 검토해 주세요.

Also applies to: 147-178


256-269: 접근성: 제거 아이콘에 contentDescription 추가 필요

상호작용 요소(onRemove)에 설명이 없어 보조기기에 비노출됩니다. 문자열 리소스를 사용해 설명을 제공하세요.

@@
-            Icon(
+            Icon(
                     modifier = Modifier
                             .size(30.dp)
                             .clickable(
                                     interactionSource = remember { MutableInteractionSource() },
                                     indication = null,
                                     onClick = onRemove,
                             )
                             .padding(5.dp),
                     painter = painterResource(id = R.drawable.icon_cancel_small),
                     tint = BezierTheme.colors.txtBlackDark,
-                    contentDescription = null,
+                    contentDescription = stringResource(id = R.string.cd_banner_remove),
             )

추가로 다음 import와 문자열 리소스 정의가 필요합니다.

+import androidx.compose.ui.res.stringResource

res/values/strings.xml:

<string name="cd_banner_remove">배너 닫기</string>

313-315: 미리보기 단순화: 불필요한 leftIconColor 지정 제거

기본값이 Color.Unspecified이고 내부에서 테마 색(BezierTheme.colors.txtBlackDark)로 처리되어 현재 지정은 중복입니다. 미리보기 가독성을 위해 제거를 권장합니다.

-            leftIconColor = BezierTheme.colors.txtBlackDark,

Also applies to: 327-329, 342-343, 365-366, 398-399, 453-454

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9444ce7 and 71a0c77.

📒 Files selected for processing (1)
  • bezier/src/main/java/io/channel/bezier/component/Banner.kt (13 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: check-build
🔇 Additional comments (5)
bezier/src/main/java/io/channel/bezier/component/Banner.kt (5)

69-71: 레거시 → 신규 파라미터 브리지 매핑 적절

기존 icon/iconColor를 leftIcon/leftIconColor로 정확히 전달하고 rightIcon은 명시적으로 null 처리한 점 좋습니다.

Also applies to: 105-107


186-189: BannerLayout 파라미터 확장 LGTM

내부 시그니처가 새 API(left/right)와 일관되도록 정리된 점 좋습니다.


217-224: leftIcon 접근성 확인

선행 아이콘이 장식 목적이면 contentDescription = null 유지가 타당하지만, 의미가 있는 경우(상태 전달 등)에는 설명을 제공해야 합니다. 사용처 의도 확인 부탁드립니다.


275-277: rightIcon 표시는 onClick 전제 — 스펙 일치 여부 확인

행 전체 클릭(onClick)일 때만 우측 아이콘을 보여주는 설계는 이해됩니다. onRemove가 함께 제공되면 우측 아이콘이 숨겨지는 현행 규칙이 의도와 일치하는지 확인 부탁드립니다.


425-427: 미리보기: rightIcon 사용 예시 좋습니다

클릭 가능한 배너에서 기본 체브론 대체 케이스를 잘 보여줍니다.

@vvvvvoin vvvvvoin requested a review from malibinYun September 18, 2025 05:22
@vvvvvoin vvvvvoin changed the title 배너 스펙 확장 - left, right icon을 구분하여 설정할 수 있돌고 수정 [MOB1-1742] 배너 스펙 확장 - left, right icon을 구분하여 설정할 수 있돌고 수정 Sep 19, 2025
Comment on lines 44 to 45
replaceWith = ReplaceWith("Banner(type, description, modifier, title, leftIcon = icon, leftIconColor = iconColor, onClick, onRemove, content)")
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이건 코드래빗 말처럼 통일하는 게 좋겠는데요?

Comment on lines +120 to +123
leftIcon: Painter? = null,
leftIconColor: Color = Color.Unspecified,
rightIcon: Painter? = null,
onClick: (() -> Unit)? = null,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rightIconColor는 필요 없나요? 넣는 게 나아보여서요

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

라이트는 버튼 스펙을 따라가서 고정으로 생각해서 색상은 따로 넣지는 않았습니당
그래도 혹시 모르니 요건 디자인팀에 확인해볼게요

Comment on lines +188 to 190
rightIcon: Painter?,
onClick: (() -> Unit)?,
onRemove: (() -> Unit)?,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rightIcon를 커스텀할 수 있음으로써 onClick과 onRemove의 차이에 대해 인지하기가 어려울 것으로 우려돼요.
onRemove를 지우고 onClick으로 통일하는 건 어떠신가요?
앞으로 아이콘은 onRemove나 onClick의 nullable여부로 판단해서 표시해주는 게 아닌, 그냥 커스텀 아이콘으로만 표시하도록이요.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onClick으로 통합하면 X버튼을 눌러서 닫는 느낌이 아니라 배너 어디든 클릭해서 닫힐거 같아서 뭔가 구분이 필요해 보입니다.
요것도 디자인 의도가 좀 더 명확해야할거 같기도 하네요

Comment on lines +147 to +159
@Composable
fun Banner(
type: BannerType,
description: String,
modifier: Modifier = Modifier,
title: String? = null,
leftIcon: Painter? = null,
leftIconColor: Color = Color.Unspecified,
rightIcon: Painter? = null,
onClick: (() -> Unit)? = null,
onRemove: (() -> Unit)? = null,
content: (@Composable () -> Unit)? = null,
) {
Copy link
Contributor

@onebone onebone Sep 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

기본 파라미터 값 때문에 deprecated 된 Banner의 오버로드와 호출부의 형태가 겹쳐버리는 것 같아요. title, descripion, type만 값을 지정하면 의도와 달리 deprecated된 오버로드로 가는 것 같습니다!

기존에 라이브러리를 사용하는 곳에서 icon이 사용되지 않는 경우가 많이 없다면 이대로 두는 것도 방법일 것 같은데, 그렇지 않으면 @Deprecated 지정한 오버로드에 level = DeprecationLevel.HIDDEN을 달아두는 것도 고려해봐야 할 것 같네요. 다만 이러면 source-breaking change가 돼서 minor 버전을 올리거나 해야 할 것 같습니다

@vvvvvoin vvvvvoin requested a review from malibinYun November 3, 2025 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants